import './assets/main.css'

import { createApp } from 'vue'

import App from './App.vue'
import router from './router/index'
import pinia from './stores'
import 'virtual:svg-icons-register'
// 导入全局 SVG 图标组件
import SvgIcon from '@/components/icons/ViteSvgIcon.vue'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/theme-chalk/dark/css-vars.css'
import './permission'
import { isHasButton } from '@/directive/has'
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
isHasButton(app)
// 全局注册 SVG 图标组件
app.component('SvgIcon', SvgIcon)
app.use(router)
app.use(pinia)

app.mount('#app')
